package com.bjpowernode.rbac.service.impl;

import com.bjpowernode.rbac.entity.CustomerTransfer;
import com.bjpowernode.rbac.entity.SystemDictionaryItem;
import com.bjpowernode.rbac.mapper.CustomerTransferMapper;
import com.bjpowernode.rbac.query.HistoryQuery;
import com.bjpowernode.rbac.service.CustomerTransferService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jy
 * @version 1.0
 * @date 2022/2/11 21:14
 */
@Service
public class CustomerTransferServiceImpl implements CustomerTransferService {

    @Autowired
    private CustomerTransferMapper customerTransferMapper;

    @Override
    public PageInfo<CustomerTransfer> selectOldOrNewSeller() {
        List<CustomerTransfer> list = customerTransferMapper.selectTheOldOrNewSeller();
        return new PageInfo<>(list);
    }

    @Override
    public PageInfo<CustomerTransfer> selectTransferByCondiTion(HistoryQuery historyQuery) {
        PageHelper.startPage(historyQuery.getCurrentPage(),historyQuery.getPageSize());
        List<CustomerTransfer> transfers = customerTransferMapper.selectByCondition(historyQuery);
        return new PageInfo<>(transfers);
    }
}
